package com.chenkaiwei.eurekaclientdemo;


import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.extra.servlet.ServletUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sun.nio.ch.Net;

@RestController
@RequestMapping("/data")
public class DemoController {

    @Value("${server.port}")
    private int serverPort;

    @GetMapping("/whoicalled")
    public String whoicalled(){

        return "data from client data："+NetUtil.getLocalhostStr()+":"+serverPort;
    }
}
